<!DOCTYPE html>
<html>
<head>
    {include file="Public:header"}
</head>
<body class="white-bg" style="padding: 3px">
<div class="page-heade">
    <h2 class="title_color text-center">用户管理</h2>
</div>
<div class="padding-10">
    <span class="lr_5"></span>
    <a href="{:url('manage')}" class="btn btn-info" style="float: right;">返回</a>
</div>
<div class="padding-10">

    <table class="table table-striped table-bordered table-hover bud_hei text-center" id="editable">
        <thead>
            <tr class="info">
                <th class="text-center">No.</th>
                <th class="text-center">用户名</th>
                <th class="text-center">角色</th>
                <th class="text-center">对应职员</th>
                <th class="text-center">用户类型</th>
                <th class="text-center">状态</th>
                <th class="text-center">是否允许移动端登录</th>
                <th class="text-center">微信号</th>
                <th class="text-center">操作</th>
            </tr>
        </thead>
        <tbody>
        {volist name="data" id="row" key="k"}
            <tr class="gradeX">
                <td>{$k+(request()->param('page')?request()->param('page'):1-1)*10}</td>
                <td>{$row.login_name}</td>
                <td>{$row.role}</td>
                <td>{$row.em_name}</td>
                <td>{$row.yhlx}</td>
                <td>{$row.state}</td>
                <td>{$row.power}</td>
                <td>{$row.wechat}</td>
                <td>
                    <a href="{:url('enable',['id'=>$row.id])}" class="enable">启用</a>
                </td>
            </tr>
        {/volist}
        </tbody>

    </table>
     <div>
         {$page}
     </div>
</div>

</body>
</html>
{include file="Public:footer"}
<script>
    $(function () {

        //启用
        $('.enable').on('click',function () {
            var link = $(this).prop('href')
            swal({
                    title: "您确定要启用该条嘛?",
                    text: "",
                    type: "warning",
                    showCancelButton: true,
                    confirmButtonColor: "#DD6B55",
                    confirmButtonText: "确定",
                    cancelButtonText: "取消",
                    closeOnConfirm: false
                },
                function(is) {
                    if(is){
                        $.post(link,function (data) {
                            if(data.success){
                                swal({title:data.msg},function () {
                                    location.reload()
                                })
                            }else{
                                swal('',data.msg,'error')
                            }
                        },'json')
                    }
                })
            return false
        })

    })
</script>